******************************Replication Code for*************************************************
*******Who Leaves and Who Returns? IDPs and Returnees after the Russian Invasion of Ukraine********
*******by Konstantin Ash. Forthcoming in Comparative Migration Studies*****************************
***************************************************************************************************


#delimit;
clear;
cd "~/"
insheet using migration_final.csv;

****Label Variables***
label var returnee "Returnee?";
label var age_num  "Age";
label var education "Education";
label var female  "Female";
label var children "Have Children";
label var married "Married";
label var zsu_connection "Know Someone in ZSU";
label var wounded_connection  "Know Someone who was Wounded or Killed";
label var survey_russian "Survey in Russian";
label var income "Income";
label var revolution_future_2014  "Ukraine�s Future after 2014";
label var eu_now "Ukraine must Join EU";
label var ussr_our_history "History of USSR is Ukraine�s History";
label var language_no_divide "Should not Discriminate by Language";
label var brotherly_people "Russians and Ukrainians brotherly peoples";
label var zelensky_fav  "Zelensky Favorability";
label var poroshenko_fav "Poroshenko Favorability";
label var nationalism "Nationalism";
label var east_orig "Eastern Ukraine";
label var south_orig "Southern Ukraine";
label var center_orig "Central Ukraine";
label var democracy1 "Democracy is the Best System";
label var democracy2 "Rarely Elect Best People";
label var democracy3 "President Must Rule without Rada";
label var migrant_bin "Migration Choice Binary";
label var migrant "Migration Choice";


***Generate Original Oblast Fixed Effects - Referential, already in dataset***;
gen east_orig=0;
replace east_orig=1 if oblast_orig=="Donetsk" | oblast_orig=="Luhansk" | oblast_orig=="Kharkiv" ;
gen south_orig=0;
replace south_orig=1 if oblast_orig=="Dnipropetrovsk" | oblast_orig=="Mykolaiv" | oblast_orig=="Zaporizhzhia" | oblast_orig=="Kherson" | oblast_orig=="Odesa"  ;
gen center_orig=0;
replace center_orig=1 if oblast_orig=="Kyiv" | oblast_orig=="Kyiv city" | oblast_orig=="Kyiv oblast" | oblast_orig=="Sumy" | oblast_orig=="Chernihiv" | oblast_orig=="Cherkasy" | oblast_orig=="Khmelnytskyi" | oblast_orig=="Chernihiv"  | oblast_orig=="Kirovgrad"    | oblast_orig=="Poltava"  | oblast_orig=="Zhytomyr"  | oblast_orig=="Vinnytsia"   ;


***Table 1: Means Across Migration Type****;
sum age_num female education married children survey_russian  language_native_russian language_family_russian income zsu_connection wounded_connection revolution_future_2014 eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism democracy1 democracy2 democracy3 if migrant==0;
sum age_num female education married children  survey_russian  language_native_russian language_family_russian income zsu_connection wounded_connection revolution_future_2014 eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism democracy1 democracy2 democracy3 if migrant==2 & migrated_abroad==1;
sum age_num female education married children  survey_russian  language_native_russian language_family_russian income zsu_connection wounded_connection revolution_future_2014 eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism democracy1 democracy2 democracy3 if migrant==1 & migrated_abroad==1;



***Table 2: Logistic Regression on Internal Displacement****;

logit migrant_bin age_num education female  children married zsu_connection wounded_connection survey_russian east_orig south_orig center_orig if migrated_abroad!=2 , vce(cluster cluster_code);
eststo l4;
logit migrant_bin age_num  education income female  children married zsu_connection wounded_connection survey_russian east_orig south_orig center_orig if  migrated_abroad!=2 , vce(cluster cluster_code);
eststo l5;
logit migrant_bin age_num  education income female  children married zsu_connection wounded_connection survey_russian revolution_future_2014 east_orig south_orig center_orig if  migrated_abroad!=2 ,vce(cluster cluster_code);
eststo l6;
estout l4 l5 l6 using migration_idp.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

****Table 3: Logistic Regression on IDP Return Choice***

#delimit;
logit returnee age_num  education female  children married zsu_connection wounded_connection  survey_russian east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0,vce(cluster cluster_code);
eststo bin1;
logit returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian income east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo bin2;
logit returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian income revolution_future_2014 east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo bin3;
logit returnee age_num  education female  children married zsu_connection wounded_connection  survey_russian income revolution_future_2014  eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo bin4;
logit returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism democracy1 democracy2 democracy3 east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo bin5;
estout bin1 bin2 bin3 bin4 bin5 using bin_return.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

****Generate VIF for Tables 2 and 3 from Linear Probability Models****;

reg migrant_bin age_num education female  children married zsu_connection wounded_connection survey_russian east_orig south_orig center_orig if  migrated_abroad!=2 , cluster (cluster_code);
estat vif;
reg migrant_bin age_num  education income female  children married zsu_connection wounded_connection survey_russian east_orig south_orig center_orig if  migrated_abroad!=2 , cluster (cluster_code);
estat vif;
reg migrant_bin age_num  education income female  children married zsu_connection wounded_connection survey_russian revolution_future_2014 east_orig south_orig center_orig if  migrated_abroad!=2 ,cluster (cluster_code);
estat vif;

#delimit;
reg returnee age_num  education female  children married zsu_connection wounded_connection  survey_russian east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0,cluster (cluster_code);
estat vif;
reg returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian income east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, cluster (cluster_code);
estat vif;
reg returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian income revolution_future_2014 east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, cluster (cluster_code);
estat vif;
reg returnee age_num  education female  children married zsu_connection wounded_connection  survey_russian income revolution_future_2014  eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, cluster (cluster_code);
estat vif;
reg returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism democracy1 democracy2 democracy3 east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, cluster (cluster_code);
estat vif;

***Table 4: Multinomial Logistic Regression on Post-Displacement Decisions***;


#delimit;
mlogit migrant age_num education female  children married zsu_connection wounded_connection survey_russian east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo l1;
mlogit migrant age_num  education income female  children married zsu_connection wounded_connection survey_russian east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo l2;
mlogit migrant age_num  education income female  children married zsu_connection wounded_connection survey_russian revolution_future_2014 east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo l3;
estout l1 l2 l3 using return_idp.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

****Table 5: Multinomial Logistic Regression on Post-Displacement Decisions with political covariates***;

#delimit;
mlogit migrant age_num  education female  children married zsu_connection wounded_connection survey_russian income revolution_future_2014   eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo l10;
mlogit migrant age_num  education income female  children married zsu_connection wounded_connection survey_russian revolution_future_2014   eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism democracy1 democracy2 democracy3 east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo l11;
estout l10 l11 using return_politics_idp.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

*******************************************;
****APPENDIX CODE**************************;
*******************************************;

#delimit;
****Appendix 1: Correlations of Covariates****;

****Table A1: Correlation Coefficients of Demographic Covariates***;
corr income age_num  education female  children married zsu_connection wounded_connection survey_russian;

****Table A2: Correlation Coefficients of Political Covariates***;
corr revolution_future_2014 eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism democracy1 democracy2 democracy3;

****Appendix 2: Main Article Tables including external refugees and returnees****


****Table A3: Logistic Regression on Displacement with Refugees***;
logit migrant_bin age_num education female  children married zsu_connection wounded_connection survey_russian east_orig south_orig center_orig  , vce(cluster cluster_code);
eststo m4;
logit migrant_bin age_num  education income female  children married zsu_connection wounded_connection survey_russian east_orig south_orig center_orig , vce(cluster cluster_code);
eststo m5;
logit migrant_bin age_num  education income female  children married zsu_connection wounded_connection survey_russian revolution_future_2014 east_orig south_orig center_orig ,vce(cluster cluster_code);
eststo m6;
estout m4 m5 m6 using migration_bin.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

****Generate VIF from Linear Probability Models for Table A3****;
reg migrant_bin age_num education female  children married zsu_connection wounded_connection survey_russian east_orig south_orig center_orig  , cluster (cluster_code);
estat vif;
reg migrant_bin age_num  education income female  children married zsu_connection wounded_connection survey_russian east_orig south_orig center_orig , cluster (cluster_code);
estat vif;
reg migrant_bin age_num  education income female  children married zsu_connection wounded_connection survey_russian revolution_future_2014 east_orig south_orig center_orig ,cluster (cluster_code);
estat vif;

******Table A4: Multinomial Logistic Regression on Destination Choice****;
mlogit migrated_abroad age_num education female  children married zsu_connection wounded_connection survey_russian east_orig south_orig center_orig  ,baseoutcome(0) vce(cluster cluster_code);
eststo m7;
mlogit migrated_abroad age_num  education income female  children married zsu_connection wounded_connection survey_russian east_orig south_orig center_orig ,baseoutcome(0) vce(cluster cluster_code);
eststo m8;
mlogit migrated_abroad age_num  education income female  children married zsu_connection wounded_connection survey_russian revolution_future_2014 east_orig south_orig center_orig ,baseoutcome(0) vce(cluster cluster_code);
eststo m9;
estout m7 m8 m9 using migration_het.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

******Table A5: Multinomial Logistic Regression on Internal Migration and Return****;
mlogit migrant age_num education female  children married zsu_connection wounded_connection survey_russian east_orig south_orig center_orig if  oblast!="Abroad",baseoutcome(0) vce(cluster cluster_code);
eststo m1;
mlogit migrant age_num  education income female  children married zsu_connection wounded_connection survey_russian east_orig south_orig center_orig if  oblast!="Abroad",baseoutcome(0) vce(cluster cluster_code);
eststo m2;
mlogit migrant age_num  education income female  children married zsu_connection wounded_connection survey_russian revolution_future_2014 east_orig south_orig center_orig if  oblast!="Abroad",baseoutcome(0) vce(cluster cluster_code);
eststo m3;
estout m1 m2 m3 using return.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

*******Table A6: Multinomial Logistic Regression on Internal Migration and Return*****;
mlogit migrant age_num  education female  children married zsu_connection wounded_connection survey_russian income eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism east_orig south_orig center_orig if  oblast!="Abroad",baseoutcome(0) vce(cluster cluster_code);
eststo m10;
mlogit migrant age_num  education income female  children married zsu_connection wounded_connection survey_russian eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism democracy1 democracy2 democracy3 east_orig south_orig center_orig if  oblast!="Abroad",baseoutcome(0) vce(cluster cluster_code);
eststo m11;
estout m10 m11 using return_politics.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

***Apendix 3: TABLE OF SAMPLES ACROSS 2019 and 2022****

*****Table A7: Samples July 2019 and June 2022 National Surveys***;
clear;
insheet using ukraine_national_survey_num.csv,comma;
sum age  female  education  survey_russian family_russian native_russian expenses income eu_agreement  minsk2 revolution2004 revolution2014  ussrourhistory   nodivisionbylanguage;
sum age  female  education  survey_russian family_russian native_russian expenses income eu_agreement  minsk2 revolution2004 revolution2014  ussrourhistory   nodivisionbylanguage if cluster_type=="City 100-499 thousand" | cluster_type=="City 500-999 thousand" | cluster_type=="City over 1 million";
clear;
use migration_final;
sum age_num female education  survey_russian  language_native_russian language_family_russian expenses income  revolution_future_2004 revolution_future_2014  ussr_our_history language_no_divide
sum age_num female education  survey_russian  language_native_russian language_family_russian expenses income  revolution_future_2004 revolution_future_2014  ussr_our_history language_no_divide if cluster_population<4;
clear;

****Appendix 4: Create Nationalism Factor***
*****Table A8: Factor Analysis of Nationalism***;
factor   compliment insult ukraine_example ukraine_happier , pcf;
rotate;
predict nationalism;

alpha compliment insult ukraine_example ukraine_happier

***Appendix 5/Table A9:Geographic Origin, Destination, and Return Status of Refugees in Sample******

gen departure_oblast=migrant_oblast;
replace departure_oblast=oblast if returnee==1;
tab departure_oblast;
gen destination_oblast=returnee_location;
replace destination_oblast=oblast if pereselents==1;
tab destination_oblast;
tab oblast if returnee==1;
tab oblast migrant;

 

***Appendix 6: Family Size and Migration and Return***;


*****Table A10: Logistic Regression on Displacement II****;
gen married_children=married*children;
label var married_children "Married with Children";
#delimit;
logit migrant_bin age_num education female  married children married_children zsu_connection wounded_connection survey_russian east_orig south_orig center_orig   & migrated_abroad!=2, vce(cluster cluster_code);
eststo o4;
logit migrant_bin age_num  education income female  married children married_children zsu_connection wounded_connection survey_russian east_orig south_orig center_orig   & migrated_abroad!=2, vce(cluster cluster_code);
eststo o5;
logit migrant_bin age_num  education income female  married children married_children zsu_connection wounded_connection survey_russian revolution_future_2014 east_orig south_orig center_orig   & migrated_abroad!=2,vce(cluster cluster_code);
eststo o6;
estout o4 o5 o6 using migration3_idp.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

****VIF for Table A10****;
reg migrant_bin age_num education female  married children married_children zsu_connection wounded_connection survey_russian east_orig south_orig center_orig   & migrated_abroad!=2, vce(cluster cluster_code);
estat vif;
reg migrant_bin age_num  education income female  married children married_children zsu_connection wounded_connection survey_russian east_orig south_orig center_orig   & migrated_abroad!=2, vce(cluster cluster_code);
estat vif;
reg migrant_bin age_num  education income female  married children married_children zsu_connection wounded_connection survey_russian revolution_future_2014 east_orig south_orig center_orig   & migrated_abroad!=2,vce(cluster cluster_code);
estat vif;

*****Table A11: Logistic Regression on IDP Return Choice II****;
logit returnee age_num  education female  children married married_children zsu_connection wounded_connection  survey_russian east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0,vce(cluster cluster_code);
eststo bin1;
logit returnee age_num  education income female  children married married_children zsu_connection wounded_connection  survey_russian income east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo bin2;
logit returnee age_num  education income female  children married married_children zsu_connection wounded_connection  survey_russian income revolution_future_2014 east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo bin3;
logit returnee age_num  education female  children married married_children zsu_connection wounded_connection  survey_russian income revolution_future_2014  eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo bin4;
logit returnee age_num  education income female  children married married_children zsu_connection wounded_connection  survey_russian revolution_future_2014  eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism democracy1 democracy2 democracy3 east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo bin5;
estout bin1 bin2 bin3 bin4 bin5 using bin_return_family.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

****VIF for Table A11****;
reg returnee age_num  education female  children married married_children zsu_connection wounded_connection  survey_russian east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0,vce(cluster cluster_code);
estat vif;
reg returnee age_num  education income female  children married married_children zsu_connection wounded_connection  survey_russian income east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
estat vif;
reg returnee age_num  education female  children married married_children zsu_connection wounded_connection  survey_russian income revolution_future_2014  eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
estat vif;
reg returnee age_num  education female  children married married_children zsu_connection wounded_connection  survey_russian income revolution_future_2014  eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
estat vif;
reg returnee age_num  education income female  children married married_children zsu_connection wounded_connection  survey_russian revolution_future_2014  eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism democracy1 democracy2 democracy3 east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
estat vif;



***Appendix 7: Infrastructure Damage and Return***;
***Generate Oblast Level Damage from KSE Source - Already generated in data-set****;
gen kse_june_damage=0;
replace kse_june_damage=2 if oblast_orig=="Lviv";
replace kse_june_damage=5 if oblast_orig=="Zhytomyr";
replace kse_june_damage=82 if oblast_orig=="Kyiv oblast";
replace kse_june_damage=82 if oblast_orig=="Kyiv city";
replace kse_june_damage=40 if oblast_orig=="Chernihiv";
replace kse_june_damage=21 if oblast_orig=="Sumy";
replace kse_june_damage=96 if oblast_orig=="Kharkiv";
replace kse_june_damage=38 if oblast_orig=="Luhansk";
replace kse_june_damage=77 if oblast_orig=="Donetsk";
replace kse_june_damage=3 if oblast_orig=="Dnipropetrovsk";
replace kse_june_damage=14 if oblast_orig=="Zaporizhzhia";
replace kse_june_damage=11 if oblast_orig=="Kherson";
replace kse_june_damage=6 if oblast_orig=="Mykolaiv";
replace kse_june_damage=3 if oblast_orig=="Odesa";

*****Table A12: Logistic Regression on IDP Return Choice****;
logit returnee age_num education female  married children zsu_connection wounded_connection survey_russian kse_june_damage east_orig south_orig center_orig if  migrant!=0 & migrated_abroad!=2, vce(cluster cluster_code);
eststo v1;
logit returnee age_num  education income female  married children zsu_connection wounded_connection survey_russian kse_june_damage east_orig south_orig center_orig if  migrant!=0 & migrated_abroad!=2, vce(cluster cluster_code);
eststo v2;
logit returnee age_num  education income female  married children zsu_connection wounded_connection survey_russian revolution_future_2014 kse_june_damage east_orig south_orig center_orig if  migrant!=0 & migrated_abroad!=2, vce(cluster cluster_code);
eststo v3;
estout v1 v2 v3 using violence.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

*****Table A13: Logistic Regression on IDP Return Choice****;
logit returnee age_num education female  married children zsu_connection wounded_connection survey_russian kse_june_damage if  migrant!=0 & migrated_abroad!=2, vce(cluster cluster_code);
eststo v12;
logit returnee age_num  education income female  married children zsu_connection wounded_connection survey_russian kse_june_damage if  migrant!=0 & migrated_abroad!=2, vce(cluster cluster_code);
eststo v22;
logit returnee age_num  education income female  married children zsu_connection wounded_connection survey_russian revolution_future_2014 kse_june_damage if  migrant!=0 & migrated_abroad!=2, vce(cluster cluster_code);
eststo v32;
estout v12 v22 v32 using violence_nofe.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

****Generate VIF from Linear Probability Models for Tables A12 and A13****;
#delimit;
reg returnee age_num education female  married children zsu_connection wounded_connection survey_russian kse_june_damage east_orig south_orig center_orig if  migrant!=0 & migrated_abroad!=2, cluster( cluster_code);
estat vif;
reg returnee age_num  education income female  married children zsu_connection wounded_connection survey_russian kse_june_damage east_orig south_orig center_orig if  migrant!=0 & migrated_abroad!=2, cluster( cluster_code);
estat vif;
reg returnee age_num  education income female  married children zsu_connection wounded_connection survey_russian revolution_future_2014 kse_june_damage east_orig south_orig center_orig if  migrant!=0 & migrated_abroad!=2, cluster( cluster_code);
estat vif;
reg returnee age_num education female  married children zsu_connection wounded_connection survey_russian kse_june_damage if  migrant!=0 & migrated_abroad!=2, cluster( cluster_code);
estat vif;
reg returnee age_num  education income female  married children zsu_connection wounded_connection survey_russian kse_june_damage if  migrant!=0 & migrated_abroad!=2, cluster( cluster_code);
estat vif;
reg returnee age_num  education income female  married children zsu_connection wounded_connection survey_russian revolution_future_2014 kse_june_damage if  migrant!=0 & migrated_abroad!=2, cluster( cluster_code);
estat vif;

****Appendix 8: Language and Internal Migration Choices****;


*****Table A14: Logistic Regression on Internal Displacement III****;
logit migrant_bin age_num education female  children married zsu_connection wounded_connection  language_mix_survey russian_only east_orig south_orig center_orig if  migrated_abroad!=2 , vce(cluster cluster_code);
eststo l4;
logit migrant_bin age_num  education income female  children married zsu_connection wounded_connection  language_mix_survey russian_only east_orig south_orig center_orig if  migrated_abroad!=2 , vce(cluster cluster_code);
eststo l5;
logit migrant_bin age_num  education income female  children married zsu_connection wounded_connection  language_mix_survey russian_only revolution_future_2014 east_orig south_orig center_orig if  migrated_abroad!=2 ,vce(cluster cluster_code);
eststo l6;
estout l4 l5 l6 using migration_idp_lang.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

*****Table A15: Logistic Regression on IDP Return Choice****;
logit returnee age_num  education female  children married zsu_connection wounded_connection  language_mix_survey russian_only east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0,vce(cluster cluster_code);
eststo bin1;
logit returnee age_num  education income female  children married zsu_connection wounded_connection  language_mix_survey russian_only income east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo bin2;
logit returnee age_num  education income female  children married zsu_connection wounded_connection  language_mix_survey russian_only income revolution_future_2014 east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo bin3;
logit returnee age_num  education female  children married zsu_connection wounded_connection  language_mix_survey russian_only income revolution_future_2014   eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo bin4;
logit returnee age_num  education income female  children married zsu_connection wounded_connection  language_mix_survey russian_only revolution_future_2014  eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism democracy1 democracy2 democracy3 east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo bin5;
estout bin1 bin2 bin3 bin4 bin5 using bin_return_lang.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 


****Generate VIF from Linear Probability Models for Tables A14 and A15****;
reg migrant_bin age_num education female  children married zsu_connection wounded_connection language_mix_survey russian_only east_orig south_orig center_orig if  migrated_abroad!=2 , cluster (cluster_code);
estat vif;
reg migrant_bin age_num  education income female  children married zsu_connection wounded_connection language_mix_survey russian_only east_orig south_orig center_orig if  migrated_abroad!=2 , cluster (cluster_code);
estat vif;
reg migrant_bin age_num  education income female  children married zsu_connection wounded_connection language_mix_survey russian_only revolution_future_2014 east_orig south_orig center_orig if  migrated_abroad!=2 ,cluster (cluster_code);
estat vif;
reg returnee age_num  education female  children married zsu_connection wounded_connection  language_mix_survey russian_only east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0,cluster (cluster_code);
estat vif;
reg returnee age_num  education income female  children married zsu_connection wounded_connection  language_mix_survey russian_only income east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, cluster (cluster_code);
estat vif;
reg returnee age_num  education income female  children married zsu_connection wounded_connection  language_mix_survey russian_only income revolution_future_2014 east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, cluster (cluster_code);
estat vif;
reg returnee age_num  education female  children married zsu_connection wounded_connection  language_mix_survey russian_only income revolution_future_2014  eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, cluster (cluster_code);
estat vif;
reg returnee age_num  education income female  children married zsu_connection wounded_connection  language_mix_survey russian_only revolution_future_2014  eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism democracy1 democracy2 democracy3 east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, cluster (cluster_code);
estat vif;


****Appendix 9: Multinomial Logistic Models of IDP Return and Staying***;


*****Table A16: Multinomial Logistic Regression on Post-Displacement Decisions II****;
mlogit migrant age_num education female  married children married_children zsu_connection wounded_connection survey_russian east_orig south_orig center_orig if migrated_abroad!=2,baseoutcome(0) vce(cluster cluster_code);
eststo o1;
mlogit migrant age_num  education income female  married children married_children zsu_connection wounded_connection survey_russian east_orig south_orig center_orig if  migrated_abroad!=2,baseoutcome(0) vce(cluster cluster_code);
eststo o2;
mlogit migrant age_num  education income female  married children married_children zsu_connection wounded_connection survey_russian revolution_future_2014 east_orig south_orig center_orig if migrated_abroad!=2,baseoutcome(0) vce(cluster cluster_code);
eststo o3;
estout o1 o2 o3 using return3_idp.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

********Table A17: Multinomial Logistic Regression on Post-Displacement Decisions*****;
mlogit migrant age_num education female  children married zsu_connection wounded_connection  language_mix_survey russian_only east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo l1;
mlogit migrant age_num  education income female  children married zsu_connection wounded_connection  language_mix_survey russian_only east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo l2;
mlogit migrant age_num  education income female  children married zsu_connection wounded_connection  language_mix_survey russian_only revolution_future_2014 east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo l3;
estout l1 l2 l3 using return_idp_lang.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

********Table A18: Multinomial Logistic Regression on Post-Displacement Decisions with Political Covariates*****;
mlogit migrant age_num  education female  children married zsu_connection wounded_connection language_mix_survey russian_only income revolution_future_2014  eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo l10;
mlogit migrant age_num  education income female  children married zsu_connection wounded_connection language_mix_survey russian_only revolution_future_2014   eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism democracy1 democracy2 democracy3 east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo l11;
estout l10 l11 using return_politics_idp_lang.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

****Appendix 9.1: Changing Base Category to IDPs that did not return****

****Table A19: Multinomial Logistic Regression on Post-Displacement Decisions*****;
mlogit migrant age_num education female  children married zsu_connection wounded_connection survey_russian east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(2) vce(cluster cluster_code);
eststo k1;
mlogit migrant age_num  education income female  children married zsu_connection wounded_connection survey_russian east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(2) vce(cluster cluster_code);
eststo k2;
mlogit migrant age_num  education income female  children married zsu_connection wounded_connection survey_russian revolution_future_2014 east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(2) vce(cluster cluster_code);
eststo k3;
estout k1 k2 k3 using return_idp_base2.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

****Table A20: Multinomial Logistic Regression on Post-Displacement Decisions****;
mlogit migrant age_num  education female  children married zsu_connection wounded_connection survey_russian income revolution_future_2014   eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(2) vce(cluster cluster_code);
eststo k10;
mlogit migrant age_num  education income female  children married zsu_connection wounded_connection survey_russian revolution_future_2014  eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism democracy1 democracy2 democracy3 east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(2) vce(cluster cluster_code);
eststo k11;
estout k10 k11 using return_politics_idp_base2.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

****Appendix 10: Political Outomces One-by-one***;

****Table A21: Logistic Regression on IDP Return Choice***;

logit returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  eu_now  east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo o1;
logit returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  ussr_our_history east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo o2;
logit returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  language_no_divide east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo o3;
logit returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  brotherly_people east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo o4;
logit returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  zelensky_fav east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo o5;
logit returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  poroshenko_fav east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo o6;
logit returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  nationalism east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo o7;
logit returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  democracy1 east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo o8;
logit returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  democracy2 east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo o9;
logit returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  democracy3 east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo o10;
estout o1 o2 o3 o4 o5 o6 o7 o8 o9 o10 using return_politics_idp_1on1.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

***Variance Inflation Factors through Linear Probability Model for Table A21***
#delimit;
reg returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  eu_now  east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
estat vif;
reg returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  ussr_our_history east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
estat vif;
reg returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  language_no_divide east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
estat vif;
reg returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  brotherly_people east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
estat vif;
reg returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  zelensky_fav east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
estat vif;
reg returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  poroshenko_fav east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
estat vif;
reg returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  nationalism east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
estat vif;
reg returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  democracy1  east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
estat vif;
reg returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  democracy2 east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
estat vif;
reg returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  democracy3 east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
estat vif;

****Table A22: Multinomial Logistic Regression on Post-Displacement Decisions I****;
mlogit migrant age_num  education income female  children married zsu_connection wounded_connection survey_russian revolution_future_2014  eu_now east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo p1;
mlogit migrant age_num  education income female  children married zsu_connection wounded_connection survey_russian revolution_future_2014  ussr_our_history east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo p2;
mlogit migrant age_num  education income female  children married zsu_connection wounded_connection survey_russian revolution_future_2014  language_no_divide east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo p3;
mlogit migrant age_num  education income female  children married zsu_connection wounded_connection survey_russian revolution_future_2014  brotherly_people  east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo p4;
mlogit migrant age_num  education income female  children married zsu_connection wounded_connection survey_russian revolution_future_2014  nationalism east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo p7;
estout p1 p2 p3 p4 p7 using return_politics_1on1_1.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

****Table A23: Multinomial Logistic Regression on Post-Displacement Decisions II****;
mlogit migrant age_num  education income female  children married zsu_connection wounded_connection survey_russian revolution_future_2014  zelensky_fav east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo p5;
mlogit migrant age_num  education income female  children married zsu_connection wounded_connection survey_russian revolution_future_2014  poroshenko_fav east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo p6;
mlogit migrant age_num  education income female  children married zsu_connection wounded_connection survey_russian revolution_future_2014  democracy1 east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo p8;
mlogit migrant age_num  education income female  children married zsu_connection wounded_connection survey_russian revolution_future_2014  democracy2 east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo p9;
mlogit migrant age_num  education income female  children married zsu_connection wounded_connection survey_russian revolution_future_2014  democracy3 east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo p10;
estout  p5 p6 p8 p9 p10 using return_politics_1on1_2.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

****Appendix 11: Main Article Models without Fixed Effects***;

*****Table A24: Logistic Regression on Internal Displacement without Fixed Effects****;
logit migrant_bin age_num education female  children married zsu_connection wounded_connection survey_russian if  migrated_abroad!=2 , vce(cluster cluster_code);
eststo l4;
logit migrant_bin age_num  education income female  children married zsu_connection wounded_connection survey_russian  if  migrated_abroad!=2 , vce(cluster cluster_code);
eststo l5;
logit migrant_bin age_num  education income female  children married zsu_connection wounded_connection survey_russian revolution_future_2014 if  migrated_abroad!=2 ,vce(cluster cluster_code);
eststo l6;
estout l4 l5 l6 using migration_idp_nofe.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

****Table A25: Logistic Regression on IDP Return Choice without Fixed Effects***;

logit returnee age_num  education female  children married zsu_connection wounded_connection  survey_russian if  migrated_abroad!=2 & migrant!=0,vce(cluster cluster_code);
eststo bin1;
logit returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian income if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo bin2;
logit returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian income revolution_future_2014 if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo bin3;
logit returnee age_num  education female  children married zsu_connection wounded_connection  survey_russian income revolution_future_2014  eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo bin4;
logit returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism democracy1 democracy2 democracy3 if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo bin5;
estout bin1 bin2 bin3 bin4 bin5 using bin_return_nofe.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

****Generate VIF from Linear Probability Models for Tables A24 and A25****
reg migrant_bin age_num education female  children married zsu_connection wounded_connection survey_russian if  migrated_abroad!=2 , cluster (cluster_code);
estat vif;
reg migrant_bin age_num  education income female  children married zsu_connection wounded_connection survey_russian if  migrated_abroad!=2 , cluster (cluster_code);
estat vif;
reg migrant_bin age_num  education income female  children married zsu_connection wounded_connection survey_russian revolution_future_2014 if  migrated_abroad!=2 ,cluster (cluster_code);
estat vif;
reg returnee age_num  education female  children married zsu_connection wounded_connection  survey_russian if  migrated_abroad!=2 & migrant!=0,cluster (cluster_code);
estat vif;
reg returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian income if  migrated_abroad!=2 & migrant!=0, cluster (cluster_code);
estat vif;
reg returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian income revolution_future_2014 if  migrated_abroad!=2 & migrant!=0, cluster (cluster_code);
estat vif;
reg returnee age_num  education female  children married zsu_connection wounded_connection  survey_russian income revolution_future_2014  eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism if  migrated_abroad!=2 & migrant!=0, cluster (cluster_code);
estat vif;
reg returnee age_num  education income female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism democracy1 democracy2 democracy3 if  migrated_abroad!=2 & migrant!=0, cluster (cluster_code);
estat vif;

***Table A26: Multinomial Logistic Regression on Post-Displacement Decisions without Fixed Effects***;


mlogit migrant age_num education female  children married zsu_connection wounded_connection survey_russian  if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo l1;
mlogit migrant age_num  education income female  children married zsu_connection wounded_connection survey_russian if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo l2;
mlogit migrant age_num  education income female  children married zsu_connection wounded_connection survey_russian revolution_future_2014 if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo l3;
estout l1 l2 l3 using return_idp_nofe.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

****Table A27: Multinomial Logistic Regression on Post-Displacement Decisions without Fixed Effects***;

mlogit migrant age_num  education female  children married zsu_connection wounded_connection survey_russian income revolution_future_2014   eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism  if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo l10;
mlogit migrant age_num  education income female  children married zsu_connection wounded_connection survey_russian revolution_future_2014   eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism democracy1 democracy2 democracy3 if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo l11;
estout l10 l11 using return_politics_idp_nofe.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

*****Appendix 12: Income and 2014 Revolution Future IDKs - Table A28****;
gen income_idk if income=.;
replace income_idk=0 if income!=.;
replace income_idk=1 if income==.;
logit income_idk  female age education married children survey_russian;
eststo idk1;
gen revolution_future_2014_idk=0;
replace revolution_future_2014_idk=1 if revolution_future_2014==.;
logit revolution_future_2014_idk female age education married children survey_russian;
eststo idk2;
estout idk1 idk2 using idk.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

****Appendix 13: Categorical Operationalization of Income*****

***Generate Categorical Income Variable - Already generated in dataset***;
gen  income_1 =0 if income!=.;
replace  income_1 =1 if income==1;
label var  income_1 "income==1";
gen  income_2 =0 if income!=.;
replace  income_2 =1 if income==2;
label var  income_2 "income==2";
gen  income_3 =0 if income!=.;
replace  income_3 =1 if income==3;
label var  income_3 "income==3";
gen  income_4 =0 if income!=.;
replace  income_4 =1 if income==4;
label var  income_4 "income==4";
gen  income_5 =0 if income!=.;
replace  income_5 =1 if income==5;
label var  income_5 "income==5";
gen  income_6 =0 if income!=.;
replace  income_6 =1 if income==6;
label var  income_6 "income==6";
gen  income_7 =0 if income!=.;
replace  income_7 =1 if income==7;
label var  income_7 "income==7";

tab income returnee if democracy1!=. &  democracy2!=. &  democracy3!=. &   revolution_future_2014!=. &  eu_now!=. &  ussr_our_history!=. &  brotherly_people!=. &  zelensky_fav!=. &  poroshenko_fav!=. &  nationalism!=. & migrated_abroad!=0 & migrant!=0;


*****Table A29: Logistic Regression on Internal Displacement with Categorical Income Variables****;
xi: logit migrant_bin age_num  education income_3 income_4 income_5 income_6 income_7 female  children married zsu_connection wounded_connection survey_russian east_orig south_orig center_orig if  migrated_abroad!=2 , vce(cluster cluster_code);
eststo cat5;
xi: logit migrant_bin age_num  education income_3 income_4 income_5 income_6 income_7 female  children married zsu_connection wounded_connection survey_russian revolution_future_2014 east_orig south_orig center_orig if  migrated_abroad!=2 ,vce(cluster cluster_code);
eststo cat6;
estout cat5 cat6 using migration_idp_cat.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

****Table A30: Logistic Regression on IDP Return Choice with Categorical Income Variables***;

xi: logit returnee age_num  education   income_3 income_4 income_5 income_6 income_7 female  children married zsu_connection wounded_connection  survey_russian east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo catbin2;
xi: logit returnee age_num  education   income_3 income_4 income_5 income_6 income_7 female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014 east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo catbin3;
xi: logit returnee age_num  education   income_3 income_4 income_5 income_6 income_7 female  children married zsu_connection wounded_connection  survey_russian  revolution_future_2014  eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo catbin4;
xi: logit returnee age_num  education   income_3 income_4 income_5 income_6 income_7 female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism democracy1 democracy2 democracy3 east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, vce(cluster cluster_code);
eststo catbin5;
estout catbin2 catbin3 catbin4 catbin5 using bin_return_cat.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

****Generate VIF from Linear Probability Models for Tables A29 and A30****;
reg migrant_bin age_num  education income_3 income_4 income_5 income_6 income_7 female  children married zsu_connection wounded_connection survey_russian east_orig south_orig center_orig if  migrated_abroad!=2 , cluster (cluster_code);
estat vif;
reg migrant_bin age_num  education income_3 income_4 income_5 income_6 income_7 female  children married zsu_connection wounded_connection survey_russian revolution_future_2014 east_orig south_orig center_orig if  migrated_abroad!=2 ,cluster (cluster_code);
estat vif;
reg returnee age_num  education income_3 income_4 income_5 income_6 income_7 female  children married zsu_connection wounded_connection  survey_russian east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, cluster (cluster_code);
estat vif;
reg returnee age_num  education income_3 income_4 income_5 income_6 income_7 female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014 east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, cluster (cluster_code);
estat vif;
reg returnee age_num  education income_3 income_4 income_5 income_6 income_7 female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, cluster (cluster_code);
estat vif;
reg returnee age_num  education income_3 income_4 income_5 income_6 income_7 female  children married zsu_connection wounded_connection  survey_russian revolution_future_2014  eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism democracy1 democracy2 democracy3 east_orig south_orig center_orig if  migrated_abroad!=2 & migrant!=0, cluster (cluster_code);
estat vif;

****Table A31: Multinomial Logistic Regression on Post-Displacement Decisions with Categorical Income Variables****;

#delimit;
mlogit migrant age_num  education  income_3 income_4 income_5 income_6 income_7 female  children married zsu_connection wounded_connection survey_russian east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo lcat2;
mlogit migrant age_num  education  income_3 income_4 income_5 income_6 income_7 female  children married zsu_connection wounded_connection survey_russian revolution_future_2014 east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo lcat3;
estout lcat2 lcat3 using return_idp_cat.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 

****Table A32: Multinomial Logistic Regression on Post-Displacement Decisions with Categorical Income Variables***;

#delimit;
mlogit migrant age_num  education  income_3 income_4 income_5 income_6 income_7  female  children married zsu_connection wounded_connection survey_russian revolution_future_2014   eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo lcat10;
mlogit migrant age_num  education  income_3 income_4 income_5 income_6 income_7 female  children married zsu_connection wounded_connection survey_russian revolution_future_2014   eu_now ussr_our_history language_no_divide brotherly_people zelensky_fav  poroshenko_fav nationalism democracy1 democracy2 democracy3 east_orig south_orig center_orig if  migrated_abroad!=2 ,baseoutcome(0) vce(cluster cluster_code);
eststo lcat11;
estout lcat10 lcat11 using return_politics_idp_cat.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex); 




